clear all
set more off

use plos_data_country.dta

global geocontrols abslat rugged calsuit distcoast

* Figure 3 *

center wgirl wgige wgicc confnatgov conflocpolice confjudsys taxeff legit secure justsys, prefix(std_) standardize replace

foreach v of varlist std_wgirl-std_justsys {

center witchcraft if `v'!=., prefix(std_) standardize replace

forvalues i = 1(1)6 {
gen institutions`i' = `v'
}

eststo Fig3_1_`v': xi: reg std_witchcraft institutions1, ro
eststo Fig3_2_`v': xi: reg std_witchcraft institutions2 i.continent, ro
eststo Fig3_3_`v': xi: reg std_witchcraft institutions3 $geocontrols i.continent, ro
eststo Fig3_4_`v': xi: reg std_witchcraft institutions4 lngdppcppp $geocontrols i.continent, ro
eststo Fig3_5_`v': xi: reg std_witchcraft institutions5 religiosity $geocontrols i.continent, ro
eststo Fig3_6_`v': xi: reg std_witchcraft institutions6 kinshipsch $geocontrols i.continent, ro

capture drop institutions*

local num_`v' = e(N)

}

grstyle init
grstyle color background white
grstyle set margin 0

coefplot *wgirl, bylabel("{bf: Rule of law}" "(N = `num_std_wgirl')") ///
|| *wgige, bylabel("{bf: Gov. effectiveness}" "(N = `num_std_wgige')") ///
|| *wgicc, bylabel("{bf: Control of corruption}" "(N = `num_std_wgicc')") ///
|| *secure, bylabel("{bf: Sec. of property rights}" "(N = `num_std_secure')") ///
|| *taxeff, bylabel("{bf: Efficiency of tax admin.}" "(N = `num_std_taxeff')") ///
|| *justsys, bylabel("{bf: Efficiency of just. sys.}" "(N = `num_std_justsys')") ///
|| *legit, bylabel("{bf: Legit. of polit. auth.}" "(N = `num_std_legit')") ///
|| *conflocpolice, bylabel("{bf: Confid. in loc. police}" "(N = `num_std_conflocpolice')") ///
|| *confjudsys, bylabel("{bf: Confid. in jud. sys.}" "(N = `num_std_confjudsys')") ///
|| *confnatgov, bylabel("{bf: Confid. in nat. gov.}" "(N = `num_std_confnatgov')") ///
||, keep(institutions*) levels (95) xline(0, lwidth(vthin) lpattern(dash)) subtitle(, box bcolor(white) size(*1.2)) byopts(cols(5) xrescale) xlabel(-1 -0.5 0) nokey pstyle(p1) ylabel(,labsize(*1.2)) xlabel(,labsize(*1.2)) ysize(3) ///
coeflabels(institutions1 = "No controls" institutions2 = "Continent FE" institutions3 = "Geography" institutions4 = "Income" institutions5 = "Religiosity" institutions6 = "Kinship")
graph export "Figures\Fig3.pdf", replace

eststo clear


* Figure 4 *

center schautoembed hofidv hofuai hofivr chindependencewvs chimaginewvs traditionwvs creativewvs riskwvs uzloose crithink chtolerancewvs trustinoutwvs bloodfam mai, prefix(std_) standardize replace

forvalues i = 2(1)7 {
gen witchcraft`i'=witchcraft
}

foreach v of varlist std_schautoembed-std_mai {

center witchcraft witchcraft2-witchcraft7 if `v'!=., prefix(std_) standardize replace

eststo `v'_1: xi: reg `v' std_witchcraft, ro
eststo `v'_2: xi: reg `v' std_witchcraft2 i.continent, ro
eststo `v'_3: xi: reg `v' std_witchcraft3 $geocontrols i.continent, ro
eststo `v'_4: xi: reg `v' std_witchcraft4 lngdppcppp $geocontrols i.continent, ro
eststo `v'_5: xi: reg `v' std_witchcraft5 religiosity $geocontrols i.continent, ro
eststo `v'_6: xi: reg `v' std_witchcraft6 kinshipsch $geocontrols i.continent, ro
eststo `v'_7: xi: reg `v' std_witchcraft7 wgirl $geocontrols i.continent, ro

local num_`v' = e(N)

}

grstyle init
grstyle color background white
grstyle set margin 0

coefplot std_schautoembed*, bylabel("{bf: Autonomy}" "(N = `num_std_schautoembed')") ///
|| std_hofidv*, bylabel("{bf: Individualism}" "(N = `num_std_hofidv')") ///
|| std_hofuai*, bylabel("{bf: Uncertainty avoidance}" "(N = `num_std_hofuai')") ///
|| std_hofivr*, bylabel("{bf: Indulgence}" "(N = `num_std_hofivr')")  ///
|| std_uzloose*, bylabel("{bf: Cultural looseness}" "(N = `num_std_uzloose')")  ///
|| std_traditionwvs*, bylabel("{bf: Imp. of tradition}" "(N = `num_std_traditionwvs')")  ///
|| std_creativewvs*, bylabel("{bf: Imp. of creativity}" "(N = `num_std_creativewvs')")  ///
|| std_riskwvs*, bylabel("{bf: Imp. of risk taking}" "(N = `num_std_riskwvs')")  ///
|| std_chindependencewvs*, bylabel("{bf: Child: independence}" "(N = `num_std_chindependencewvs')")  ///
|| std_chimaginewvs*, bylabel("{bf: Child: imagination}" "(N = `num_std_chimaginewvs')")  ///
|| std_crithink*, bylabel("{bf: Critical think. in teaching}" "(N = `num_std_crithink')")  ///
|| std_trustinoutwvs*, bylabel("{bf: In- vs. out-group trust}" "(N = `num_std_trustinoutwvs')")  ///
|| std_bloodfam*, bylabel("{bf: Blood don. to family}" "(N = `num_std_bloodfam')")  ///
|| std_mai*, bylabel("{bf: Migrant acceptance}" "(N = `num_std_mai')")  ///
|| std_chtolerancewvs*, bylabel("{bf: Child: tolerance}" "(N = `num_std_chtolerancewvs')")  ///
||, keep(std_witchcraft*) levels (95) xline(0, lwidth(vthin) lpattern(dash)) subtitle(, bcolor(white) size(*0.75)) ciopts(lwidth(*0.75)) byopts(cols(5) xrescale) nokey pstyle(p1) msize(small) ysize(4.5) ylabel(,labsize(*0.75)) xlabel(,labsize(*0.75)) ///
coeflabels(std_witchcraft = "No controls" std_witchcraft2 = "Continent FE" std_witchcraft3 = "Geography" std_witchcraft4 = "Income" std_witchcraft5 = "Religiosity" std_witchcraft6 = "Kinship" std_witchcraft7 = "Institutions")
addplot 1: , xlabel(-0.8(0.4)0) norescaling
addplot 2: , xlabel(-0.8(0.4)0) norescaling
addplot 3: , xlabel(0(0.4)0.8) norescaling
addplot 4: , xlabel(-0.8(0.4)0) norescaling
addplot 5: , xlabel(-0.8(0.4)0) norescaling
addplot 6: , xlabel(0(0.4)0.8) norescaling
addplot 7: , xlabel(-0.8(0.4)0) norescaling
addplot 8: , xlabel(-0.8(0.4)0) norescaling
addplot 9: , xlabel(-0.8(0.4)0) norescaling
addplot 10: , xlabel(-0.8(0.4)0) norescaling
addplot 11: , xlabel(-0.8(0.4)0) norescaling
addplot 12: , xlabel(0(0.4)0.8) norescaling
addplot 13: , xlabel(0(0.4)0.8) norescaling
addplot 14: , xlabel(-0.8(0.4)0) norescaling
addplot 15: , xlabel(-0.8(0.4)0) norescaling
graph export "Figures\Fig4.pdf", replace

eststo clear


* Figure 5 *

center trustgen trustnbrglp trustbuspar trustoutwvs fairwvs impfriendswvs impleisurewvs blood charity strangerhelp, prefix(std_) standardize replace

capture drop witchcraft2-witchcraft7

forvalues i = 2(1)7 {
gen witchcraft`i'=witchcraft
}

eststo clear

foreach v of varlist std_trustgen-std_strangerhelp {

center witchcraft witchcraft2-witchcraft7 if `v'!=., prefix(std_) standardize replace

eststo `v'_1: xi: reg `v' std_witchcraft, ro
eststo `v'_2: xi: reg `v' std_witchcraft2 i.continent, ro
eststo `v'_3: xi: reg `v' std_witchcraft3 $geocontrols i.continent, ro
eststo `v'_4: xi: reg `v' std_witchcraft4 lngdppcppp $geocontrols i.continent, ro
eststo `v'_5: xi: reg `v' std_witchcraft5 religiosity $geocontrols i.continent, ro
eststo `v'_6: xi: reg `v' std_witchcraft6 kinshipsch $geocontrols i.continent, ro
eststo `v'_7: xi: reg `v' std_witchcraft7 wgirl $geocontrols i.continent, ro

local num_`v' = e(N)

}

grstyle init
grstyle color background white
grstyle set margin 0

coefplot std_trustgen*, bylabel("{bf: Generalized trust}" "(N = `num_std_trustgen')") ///
|| std_trustnbrglp*, bylabel("{bf: Trust in neighbors}" "(N = `num_std_trustnbrglp')") ///
|| std_trustoutwvs*, bylabel("{bf: Out-group trust}" "(N = `num_std_trustoutwvs')")  ///
|| std_trustbuspar*, bylabel("{bf: Trusted bus. partner}" "(N = `num_std_trustbuspar')") ///
|| std_fairwvs*, bylabel("{bf: Generalized fairness}" "(N = `num_std_fairwvs')")  ///
|| std_impfriendswvs*, bylabel("{bf: Import. of friends}" "(N = `num_std_impfriendswvs')")  ///
|| std_impleisurewvs*, bylabel("{bf: Import. of leisure}" "(N = `num_std_impleisurewvs')")  ///
|| std_blood*, bylabel("{bf: Blood donations}" "(N = `num_std_blood')")  ///
|| std_charity*, bylabel("{bf: Charitable giving}" "(N = `num_std_charity')")  ///
|| std_strangerhelp*, bylabel("{bf: Helped a stranger}" "(N = `num_std_strangerhelp')")  ///
||, keep(std_witchcraft*) levels (95) xline(0, lwidth(vthin) lpattern(dash)) subtitle(, bcolor(white) size(*1.2)) byopts(cols(5) xrescale) xlabel(-0.8 -0.4 0) nokey pstyle(p1) ysize(3) ylabel(,labsize(*1.2)) xlabel(,labsize(*1.2)) ///
coeflabels(std_witchcraft = "No controls" std_witchcraft2 = "Continent FE" std_witchcraft3 = "Geography" std_witchcraft4 = "Income" std_witchcraft5 = "Religiosity" std_witchcraft6 = "Kinship" std_witchcraft7 = "Institutions")
graph export "Figures\Fig5.pdf", replace

eststo clear


* Figure 6 *

center whrhappy subjhealthwvs whrposaffect whrnegaffect controlwvs whrfreechoice fatalism hardwork bzsg limgoodwvs, prefix(std_) standardize replace

capture drop witchcraft2-witchcraft7

forvalues i = 2(1)7 {
gen witchcraft`i'=witchcraft
}

eststo clear

foreach v of varlist std_whrhappy-std_limgoodwvs {

center witchcraft witchcraft2-witchcraft7 if `v'!=., prefix(std_) standardize replace

eststo `v'_1: xi: reg `v' std_witchcraft, ro
eststo `v'_2: xi: reg `v' std_witchcraft2 i.continent, ro
eststo `v'_3: xi: reg `v' std_witchcraft3 $geocontrols i.continent, ro
eststo `v'_4: xi: reg `v' std_witchcraft4 lngdppcppp $geocontrols i.continent, ro
eststo `v'_5: xi: reg `v' std_witchcraft5 religiosity $geocontrols i.continent, ro
eststo `v'_6: xi: reg `v' std_witchcraft6 kinshipsch $geocontrols i.continent, ro
eststo `v'_7: xi: reg `v' std_witchcraft7 wgirl $geocontrols i.continent, ro

local num_`v' = e(N)

}

grstyle init
grstyle color background white
grstyle set margin 0

coefplot std_whrhappy*, bylabel("{bf: Life satisfaction}" "(N = `num_std_whrhappy')") ///
|| std_subjhealthwvs*, bylabel("{bf: Subjective health}" "(N = `num_std_subjhealthwvs')") ///
|| std_whrposaffect*, bylabel("{bf: Positive affect}" "(N = `num_std_whrposaffect')")  ///
|| std_whrnegaffect*, bylabel("{bf: Negative affect}" "(N = `num_std_whrnegaffect')")  ///
|| std_controlwvs*, bylabel("{bf: Control over life}" "(N = `num_std_controlwvs')")  ///
|| std_whrfreechoice*, bylabel("{bf: Freedom of life choices}" "(N = `num_std_whrfreechoice')")  ///
|| std_fatalism*, bylabel("{bf: Fatalism}" "(N = `num_std_fatalism')")  ///
|| std_hardwork*, bylabel("{bf: Self-efficacy}" "(N = `num_std_hardwork')")  ///
|| std_bzsg*, bylabel("{bf: Zero-sum worldview}" "(N = `num_std_bzsg')")  ///
|| std_limgoodwvs*, bylabel("{bf: Image of limited good}" "(N = `num_std_limgoodwvs')")  ///
||, keep(std_witchcraft*) levels (95) xline(0, lwidth(vthin) lpattern(dash)) subtitle(, bcolor(white) size(*1.2)) byopts(cols(5) xrescale) nokey pstyle(p1) ysize(3) ylabel(,labsize(*1.2)) xlabel(,labsize(*1.2)) ///
coeflabels(std_witchcraft = "No controls" std_witchcraft2 = "Continent FE" std_witchcraft3 = "Geography" std_witchcraft4 = "Income" std_witchcraft5 = "Religiosity" std_witchcraft6 = "Kinship" std_witchcraft7 = "Institutions")
addplot 1: , xlabel(-0.8(0.4)0) norescaling
addplot 2: , xlabel(-0.8(0.4)0) norescaling
addplot 3: , xlabel(-0.8(0.4)0) norescaling
addplot 4: , xlabel(0(0.4)0.8) norescaling
addplot 5: , xlabel(-0.8(0.4)0) norescaling
addplot 6: , xlabel(-0.8(0.4)0) norescaling
addplot 7: , xlabel(0(0.4)0.8) norescaling
addplot 8: , xlabel(-0.8(0.4)0) norescaling
addplot 9: , xlabel(0(0.4)0.8) norescaling
addplot 10: , xlabel(0(0.4)0.8) norescaling
graph export "Figures\Fig6.pdf", replace

eststo clear


* Figure 7 *

center entrisk disideas patapp hindex rdtogdp, prefix(std_) standardize replace

capture drop witchcraft2-witchcraft7

forvalues i = 2(1)7 {
gen witchcraft`i'=witchcraft
}

eststo clear

foreach v of varlist std_entrisk-std_rdtogdp {

center witchcraft witchcraft2-witchcraft7 if `v'!=., prefix(std_) standardize replace

eststo `v'_1: xi: reg `v' std_witchcraft, ro
eststo `v'_2: xi: reg `v' std_witchcraft2 i.continent, ro
eststo `v'_3: xi: reg `v' std_witchcraft3 $geocontrols i.continent, ro
eststo `v'_4: xi: reg `v' std_witchcraft4 lngdppcppp $geocontrols i.continent, ro
eststo `v'_5: xi: reg `v' std_witchcraft5 religiosity $geocontrols i.continent, ro
eststo `v'_6: xi: reg `v' std_witchcraft6 kinshipsch $geocontrols i.continent, ro
eststo `v'_7: xi: reg `v' std_witchcraft7 wgirl $geocontrols i.continent, ro

local num_`v' = e(N)

}

grstyle init
grstyle color background white
grstyle set margin 0

coefplot std_entrisk*, bylabel("{bf: Entrep. risk taking}" "(N = `num_std_entrisk')")  ///
|| std_disideas*, bylabel("{bf: Disruptive ideas}" "(N = `num_std_disideas')")  ///
|| std_patapp*, bylabel("{bf: Patent applications}" "(N = `num_std_patapp')") ///
|| std_hindex*, bylabel("{bf: H-index}" "(N = `num_std_hindex')") ///
|| std_rdtogdp*, bylabel("{bf: R&D expend. in GDP}" "(N = `num_std_rdtogdp')") ///
||, keep(std_witchcraft*) levels (95) xline(0, lwidth(thin) lpattern(dash)) subtitle(, bcolor(white) size(*1.8)) ciopts(lwidth(*1.8)) byopts(cols(5) xrescale) xlabel(-0.8 -0.4 0) nokey pstyle(p1) ysize(1.5) ylabel(,labsize(*1.8)) xlabel(,labsize(*1.8)) msize(large) ///
coeflabels(std_witchcraft = "No controls" std_witchcraft2 = "Continent FE" std_witchcraft3 = "Geography" std_witchcraft4 = "Income" std_witchcraft5 = "Religiosity" std_witchcraft6 = "Kinship" std_witchcraft7 = "Institutions")
graph export "Figures\Fig7.pdf", replace

eststo clear

* Figure 8 *

center lngdppcppp lnpovrat lifexp schyears hdi, prefix(std_) standardize replace

eststo clear

foreach v of varlist std_lngdppcppp-std_hdi {

center witchcraft if `v'!=., prefix(std_) standardize replace

forvalues i = 1(1)6 {
gen development`i' = `v'
gen sqdevelopment`i' = `v'^2
}

eststo Fig8_1_`v': xi: reg std_witchcraft development1, ro
eststo Fig8_2_`v': xi: reg std_witchcraft development2 i.continent, ro
eststo Fig8_3_`v': xi: reg std_witchcraft development3 $geocontrols i.continent, ro
eststo Fig8_4_`v': xi: reg std_witchcraft development4 religiosity $geocontrols i.continent, ro
eststo Fig8_5_`v': xi: reg std_witchcraft development5 kinshipsch $geocontrols i.continent, ro
eststo Fig8_6_`v': xi: reg std_witchcraft development6 wgirl $geocontrols i.continent, ro

eststo Fig8_1_`v'sq: xi: reg std_witchcraft development1 sqdevelopment1, ro
eststo Fig8_2_`v'sq: xi: reg std_witchcraft development2 sqdevelopment2 i.continent, ro
eststo Fig8_3_`v'sq: xi: reg std_witchcraft development3 sqdevelopment3 $geocontrols i.continent, ro
eststo Fig8_4_`v'sq: xi: reg std_witchcraft development4 sqdevelopment4 religiosity $geocontrols i.continent, ro
eststo Fig8_5_`v'sq: xi: reg std_witchcraft development5 sqdevelopment5 kinshipsch $geocontrols i.continent, ro
eststo Fig8_6_`v'sq: xi: reg std_witchcraft development6 sqdevelopment6 wgirl $geocontrols i.continent, ro

drop development* sqdevelopment*

local num_`v' = e(N)

}

grstyle init
grstyle color background white
grstyle set margin 0

coefplot (*lngdppcppp, keep(development*)), bylabel("{bf: GDP per capita}" "(N = `num_std_lngdppcppp')") ///
|| (*lnpovrat, keep(development*)), bylabel("{bf: Poverty rate}" "(N = `num_std_lnpovrat')") ///
|| (*lifexp, keep(development*)), bylabel("{bf: Life expectancy}" "(N = `num_std_lifexp')") ///
|| (*schyears, keep(development*)), bylabel("{bf: Years of schooling}" "(N = `num_std_schyears')") ///
|| (*hdi, keep(development*)), bylabel("{bf: HDI}" "(N = `num_std_hdi')") ///
|| (*lngdppcpppsq, keep(development*) offset(-0.15) pstyle(p1)) (*lngdppcpppsq, keep(sqdevelopment*) offset(0.15) pstyle(p3) msymbol(S)), bylabel("{bf: GDP per capita}" "(N = `num_std_lngdppcppp')") ///
|| (*lnpovrat, keep(development*) offset(-0.15) pstyle(p1)) (*lnpovratsq, keep(sqdevelopment*) offset(0.15) pstyle(p3) msymbol(S)), bylabel("{bf: Poverty rate}" "(N = `num_std_lnpovrat')") ///
|| (*lifexp, keep(development*) offset(-0.15) pstyle(p1)) (*lifexpsq, keep(sqdevelopment*) offset(0.15) pstyle(p3) msymbol(S)), bylabel("{bf:Life expectancy}" "(N = `num_std_lifexp')") ///
|| (*schyears, keep(development*) offset(-0.15) pstyle(p1)) (*schyearssq, keep(sqdevelopment*) offset(0.15) pstyle(p3) msymbol(S)), bylabel("{bf: Years of schooling}" "(N = `num_std_schyears')") ///
|| (*hdi, keep(development*) offset(-0.15) pstyle(p1)) (*hdisq, keep(sqdevelopment*) offset(0.15) pstyle(p3) msymbol(S)), bylabel("{bf: HDI}" "(N = `num_std_hdi')") ///
||, levels (95) xline(0, lwidth(vthin) lpattern(dash)) subtitle(, box bcolor(white) size(*1.2)) byopts(cols(5) xrescale) xlabel(-0.5 0 0.5) nokey pstyle(p1) ysize(3) ylabel(,labsize(*1.2)) xlabel(,labsize(*1.2)) ///
coeflabels(development1 = "No controls" development2 = "Continent FE" development3 = "Geography" development4 = "Religiosity" development5 = "Kinship" development6 = "Institutions") ///
rename(sqdevelopment1=development1 sqdevelopment2=development2 sqdevelopment3=development3 sqdevelopment4=development4 sqdevelopment5=development5 sqdevelopment6=development6)
graph export "Figures\Fig8.pdf", replace

eststo clear


* Figure 9 *

center disastexp droughtexp disrichness newconfreq unemprate, prefix(std_) standardize replace

eststo clear

foreach v of varlist std_disastexp-std_unemprate {

center witchcraft if `v'!=., prefix(std_) standardize replace

forvalues i = 1(1)7 {
gen misfortune`i' = `v'
}

eststo Fig9_1_`v': xi: reg std_witchcraft misfortune1, ro
eststo Fig9_2_`v': xi: reg std_witchcraft misfortune2 i.continent, ro
eststo Fig9_3_`v': xi: reg std_witchcraft misfortune3 $geocontrols i.continent, ro
eststo Fig9_4_`v': xi: reg std_witchcraft misfortune4 lngdppcppp $geocontrols i.continent, ro
eststo Fig9_5_`v': xi: reg std_witchcraft misfortune5 religiosity $geocontrols i.continent, ro
eststo Fig9_6_`v': xi: reg std_witchcraft misfortune6 kinshipsch $geocontrols i.continent, ro
eststo Fig9_7_`v': xi: reg std_witchcraft misfortune7 wgirl $geocontrols i.continent, ro

drop misfortune*

local num_`v' = e(N)

}

grstyle init
grstyle color background white // set overall background to white
grstyle set margin 0

coefplot *disastexp, bylabel("{bf: Exp. to natural disasters }" "(N = `num_std_disastexp')") ///
|| *droughtexp, bylabel("{bf: Exp. to agric. drought}" "(N = `num_std_droughtexp')") ///
|| *disrichness, bylabel("{bf: Pathogen richness}" "(N = `num_std_disrichness')") ///
|| *newconfreq, bylabel("{bf: Armed civil conflict}" "(N = `num_std_newconfreq')") ///
|| *unemprate, bylabel("{bf: Unemployment rate}" "(N = `num_std_unemprate')") ///
||, keep(misfortune*) levels (95) xline(0, lwidth(thin) lpattern(dash)) subtitle(, bcolor(white) size(*1.8)) ciopts(lwidth(*1.5)) byopts(cols(5) xrescale) nokey pstyle(p1) ysize(1.5) ylabel(,labsize(*1.8)) xlabel(,labsize(*1.8)) msize(large) ///
coeflabels(misfortune1 = "No controls" misfortune2 = "Continent FE" misfortune3 = "Geography" misfortune4 = "Income" misfortune5 = "Religiosity" misfortune6 = "Kinship" misfortune7 = "Institutions")
addplot 1: , xlabel(-0.3(0.3)0.3) norescaling
addplot 2: , xlabel(0(0.3)0.6) norescaling
addplot 3: , xlabel(-0.3(0.3)0.3) norescaling
addplot 4: , xlabel(-0.3(0.3)0.3) norescaling
addplot 5: , xlabel(0(0.3)0.6) norescaling
graph export "Figures\Fig9.pdf", replace

eststo clear


* Table A.3 of S1 Appendix *

tab continent, gen(continent_s)

global institutions wgirl wgige wgicc secure taxeff justsys legit conflocpolice confjudsys confnatgov
global conformity schautoembed hofidv hofuai hofivr uzloose traditionwvs creativewvs riskwvs chindependencewvs chimaginewvs crithink trustinoutwvs bloodfam chtolerancewvs mai
global antisocial trustgen trustnbrglp trustoutwvs trustbuspar fairwvs impfriendswvs impleisurewvs blood charity strangerhelp
global anxiety whrhappy subjhealthwvs whrposaffect whrnegaffect controlwvs whrfreechoice fatalism hardwork bzsg limgoodwvs
global innovation entrisk disideas patapp hindex rdtogdp
global development lngdppcppp lnpovrat lifexp schyears hdi
global misfortune disastexp droughtexp disrichness newconfreq unemprate

estpost tabstat witchcraft continent_s* $geocontrols religiosity kinshipsch $institutions $conformity $antisocial $anxiety $innovation $development $misfortune, c(stat) stat(mean sd min max n)

esttab using "Tables\TableA3.tex", replace label cells("mean(fmt(%-9.2gc)) sd(fmt(%-9.2gc)) min max count") nonumber ///
  nomtitle nonote noobs collabels("Mean" "St. dev." "Min" "Max" "Obs.") booktabs

eststo clear
  
* Figure C.1 of S1 Appendix *

* Rule of law
quietly: xi: reg witchcraft wgirl i.continent, ro
local tstat: di %3.2f _b[wgirl]/_se[wgirl]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg wgirl i.continent, ro
quietly: predict wgirl_res, resid

twoway scatter witchcraft_res wgirl_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit witchcraft_res wgirl_res, /// 
xtitle("Rule of law") ytitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC1_1.pdf", replace

drop *res

* Security of property rights
quietly: xi: reg witchcraft secure i.continent, ro
local tstat: di %3.2f _b[secure]/_se[secure]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg secure i.continent, ro
quietly: predict secure_res, resid

twoway scatter witchcraft_res secure_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit witchcraft_res secure_res, /// 
xtitle("Security of property rights") ytitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC1_2.pdf", replace

drop *res

* Confidence in local police
quietly: xi: reg witchcraft conflocpolice i.continent, ro
local tstat: di %3.2f _b[conflocpolice]/_se[conflocpolice]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg conflocpolice i.continent, ro
quietly: predict conflocpolice_res, resid

twoway scatter witchcraft_res conflocpolice_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit witchcraft_res conflocpolice_res, /// 
xtitle("Confidence in local police") ytitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC1_3.pdf", replace

drop *res


* Figure C.2 of S1 Appendix *

* Autonomy vs embeddedness
quietly: xi: reg schautoembed witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg schautoembed i.continent, ro
quietly: predict schautoembed_res, resid

twoway scatter schautoembed_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit schautoembed_res witchcraft_res, /// 
ytitle("Autonomy vs. embeddedness") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC2_1.pdf", replace

drop *res

* Individualism
quietly: xi: reg hofidv witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3f 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg hofidv i.continent, ro
quietly: predict hofidv_res, resid

twoway scatter hofidv_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit hofidv_res witchcraft_res, /// 
ytitle("Individualism vs. collectivism") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC2_2.pdf", replace

drop *res

* indulgence vs. restraint
quietly: xi: reg hofivr witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg hofivr i.continent, ro
quietly: predict hofivr_res, resid

twoway scatter hofivr_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit hofivr_res witchcraft_res, /// 
ytitle("Indulgence vs. restraint") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC2_3.pdf", replace

drop *res

* tradition
quietly: xi: reg traditionwvs witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg traditionwvs i.continent, ro
quietly: predict traditionwvs_res, resid

twoway scatter traditionwvs_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit traditionwvs_res witchcraft_res, /// 
ytitle("Importance of tradition") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC2_4.pdf", replace

drop *res

* creativity
quietly: xi: reg creativewvs witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg creativewvs i.continent, ro
quietly: predict creativewvs_res, resid
twoway scatter creativewvs_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit creativewvs_res witchcraft_res, /// 
ytitle("Importance of creativity") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC2_5.pdf", replace

drop *res

* migrant acceptance index
quietly: xi: reg mai witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg mai i.continent, ro
quietly: predict mai_res, resid

twoway scatter mai_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit mai_res witchcraft_res, /// 
ytitle("Migrant acceptance index") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC2_6.pdf", replace

drop *res


* Figure C.3 of S1 Appendix *

* generalized trust
quietly: xi: reg trustgen witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg trustgen i.continent, ro
quietly: predict trustgen_res, resid

twoway scatter trustgen_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit trustgen_res witchcraft_res, /// 
ytitle("Generalized trust") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC3_1.pdf", replace

drop *res

* generalized fairness
quietly: xi: reg fairwvs witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg fairwvs i.continent, ro
quietly: predict fairwvs_res, resid

twoway scatter fairwvs_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit fairwvs_res witchcraft_res, /// 
ytitle("Generalized fairness") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC3_2.pdf", replace

drop *res

* recent charitable contributions
quietly: xi: reg charity witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg charity i.continent, ro
quietly: predict charity_res, resid

twoway scatter charity_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit charity_res witchcraft_res, /// 
ytitle("Recent charitable giving") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC3_3.pdf", replace

drop *res


* Figure C.4 of S1 Appendix *

* happiness
quietly: xi: reg whrhappy witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg whrhappy i.continent, ro
quietly: predict whrhappy_res, resid

twoway scatter whrhappy_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit whrhappy_res witchcraft_res, /// 
ytitle("Life satisfaction") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC4_1.pdf", replace

drop *res

* locus of control
quietly: xi: reg controlwvs witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg controlwvs i.continent, ro
quietly: predict controlwvs_res, resid

twoway scatter controlwvs_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit controlwvs_res witchcraft_res, /// 
ytitle("Control over life") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC4_2.pdf", replace

drop *res

* belief in zero-sum game
quietly: xi: reg bzsg witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3f 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg bzsg i.continent, ro
quietly: predict bzsg_res, resid

twoway scatter bzsg_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit bzsg_res witchcraft_res, /// 
ytitle("Zero-sum worldview") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC4_3.pdf", replace

drop *res


* Figure C.5 of S1 Appendix *

* Appetite for entrepreneurial risk
quietly: xi: reg entrisk witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg entrisk i.continent, ro
quietly: predict entrisk_res, resid

twoway scatter entrisk_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit entrisk_res witchcraft_res, /// 
ytitle("Appetite for entrepreneurial risk") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC5_1.pdf", replace

drop *res

* patents
quietly: xi: reg patapp witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg patapp i.continent, ro
quietly: predict patapp_res, resid

twoway scatter patapp_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit patapp_res witchcraft_res, /// 
ytitle("Patent applications") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC5_2.pdf", replace

drop *res

* R&D expenditures in GDP
quietly: xi: reg rdtogdp witchcraft i.continent, ro
local tstat: di %3.2f _b[witchcraft]/_se[witchcraft]
local pval: di %4.3e 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg rdtogdp i.continent, ro
quietly: predict rdtogdp_res, resid

twoway scatter rdtogdp_res witchcraft_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit rdtogdp_res witchcraft_res, /// 
ytitle("Share of R&D expend. in GDP") xtitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC5_3.pdf", replace

drop *res


* Figure C.6 of S1 Appendix *

* gdp per capita (linear)
quietly: xi: reg witchcraft lngdppcppp i.continent, ro
local tstat: di %3.2f _b[lngdppcppp]/_se[lngdppcppp]
local pval: di %4.3f 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg lngdppcppp i.continent, ro
quietly: predict lngdppcppp_res, resid

twoway scatter witchcraft_res lngdppcppp_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit witchcraft_res lngdppcppp_res, /// 
xtitle("Log real GDP per capita at PPP") ytitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC6_1.pdf", replace

drop *res

* mean years of schooling (linear)
quietly: xi: reg witchcraft schyears i.continent, ro
local tstat: di %3.2f _b[schyears]/_se[schyears]
local pval: di %4.3f 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg schyears i.continent, ro
quietly: predict schyears_res, resid

twoway scatter witchcraft_res schyears_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit witchcraft_res schyears_res, /// 
xtitle("Mean years of schooling") ytitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC6_2.pdf", replace

drop *res

* HDI (linear)
quietly: xi: reg witchcraft hdi i.continent, ro
local tstat: di %3.2f _b[hdi]/_se[hdi]
local pval: di %4.3f 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg hdi i.continent, ro
quietly: predict hdi_res, resid

twoway scatter witchcraft_res hdi_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit witchcraft_res hdi_res, /// 
xtitle("Human development index") ytitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC6_3.pdf", replace

drop *res

* augmented component plus residual plots

gen lngdppcppp_sq = lngdppcppp^2

xi: reg witchcraft lngdppcppp lngdppcppp_sq i.continent, ro
predict res, residuals
gen fit = _b[lngdppcppp]*lngdppcppp + _b[lngdppcppp_sq]*lngdppcppp_sq + res

twoway scatter fit lngdppcppp, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || qfit fit lngdppcppp, ///
xtitle("Log real GDP per capita at PPP") ytitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge))
graph export "Figures\FigC6_4.pdf", replace

drop res fit lngdppcppp_sq

gen schyears_sq = schyears^2

xi: reg witchcraft schyears schyears_sq i.continent, ro
predict res, residuals
gen fit = _b[schyears]*schyears + _b[schyears_sq]*schyears_sq + res

twoway scatter fit schyears, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || qfit fit schyears, ///
xtitle("Mean years of schooling") ytitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge))
graph export "Figures\FigC6_5.pdf", replace

drop res fit schyears_sq

gen hdi_sq = hdi^2

xi: reg witchcraft hdi hdi_sq i.continent, ro
predict res, residuals
gen fit = _b[hdi]*hdi + _b[hdi_sq]*hdi_sq + res

twoway scatter fit hdi, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || qfit fit hdi, ///
xtitle("Human development index") ytitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge))
graph export "Figures\FigC6_6.pdf", replace

drop res fit hdi_sq


* Figure C.7 of S1 Appendix *

* exposure to drought
quietly: xi: reg witchcraft droughtexp i.continent, ro
local tstat: di %3.2f _b[droughtexp]/_se[droughtexp]
local pval: di %4.3f 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg droughtexp i.continent, ro
quietly: predict droughtexp_res, resid

twoway scatter witchcraft_res droughtexp_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit witchcraft_res droughtexp_res, /// 
xtitle("Exposure to agircultural drought") ytitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC7_1.pdf", replace

drop *res

* pathogen richness
quietly: xi: reg witchcraft disrichness i.continent, ro
local tstat: di %3.2f _b[disrichness]/_se[disrichness]
local pval: di %4.3f 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg disrichness i.continent, ro
quietly: predict disrichness_res, resid

twoway scatter witchcraft_res disrichness_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit witchcraft_res disrichness_res, /// 
xtitle("Pathogen richness") ytitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC7_2.pdf", replace

drop *res

* unemployment rate
quietly: xi: reg witchcraft unemprate i.continent, ro
local tstat: di %3.2f _b[unemprate]/_se[unemprate]
local pval: di %4.3f 2*ttail(e(df_r), abs(`tstat'))
quietly: xi: reg witchcraft i.continent, ro
quietly: predict witchcraft_res, resid
quietly: xi: reg unemprate i.continent, ro
quietly: predict unemprate_res, resid

twoway scatter witchcraft_res unemprate_res, msty(p7) mlw(vthin) mlc(black) msize(medlarge) || lfit witchcraft_res unemprate_res, /// 
xtitle("Unemployment rate") ytitle("Witchcraft beliefs") scheme(gap_axes) graphregion(color(white) margin(1 2 0 1)) bgcolor(white) legend(off) ///
ylabel(,labsize(medlarge)) xlabel(,labsize(medlarge)) ///
note("N=`e(N)', t=`tstat', p=`pval'", pos(12) size(large))
graph export "Figures\FigC7_3.pdf", replace

drop *res
